#ifndef __NAGIOS_PERF_H__
#define __NAGIOS_PERF_H__

#include "BufferStream.h"

class NagiosPerf
{
	char * mData;
	char * mHead;
	char * mLast;
	char mChar;
	int mType;
protected:
    char * Read(const char * field);
	int CheckType();
    int ReadHostFields();
	int ReadServiceFields();
public:
	int line_no;
	time_t mTime;
	char mHost[64];
	char mService[64];
	char mCommand[128];
	char * mPerfData;
	char mState;
public:
	NagiosPerf();
	~NagiosPerf();

	int Load(FILE * fp);
	int toJson(KeyPairOutter & out);
};

#endif
